#include <bits/stdc++.h>
using namespace std;
long long a[100005],h[100005],pre[100005];
long long n,ans=0,x,cnt=0;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    memset(h,0,sizeof(h));
    cin>>n;
    ans=n;
    for (int i=1;i<=n;i++){
        cin>>x;
        h[x]++;
    }
    for (int i=1;i<=100000;i++){
        if (h[i]!=0) {
            cnt++;
            a[cnt]=h[i];
        }
    }
    pre[0]=0;
    for (int i=1;i<=cnt;i++){
        pre[i]=pre[i-1]+a[i];
    }
    for (int i=2;i<=cnt;i++){
        ans=ans-min(a[i],pre[i-1]);
        if (pre[i-1]-a[i]<0) {
            pre[i-1]=0;
            for (int j=i;j<=cnt;j++)
                pre[i]=pre[i-1]+a[i];

        }
        else {
            pre[i-1]=pre[i-1]-a[i];
            for (int j=i;j<=cnt;j++)
                pre[i]=pre[i-1]+a[i];
        }
    }
    if (ans>0) cout<<ans;
    else cout<<0;
    return 0;
}
